package gui.lesson01;

import java.awt.*;

public class TestFrame01 {
    public static void main(String[] args) {
        MyFrame myFrame0 = new MyFrame(200, 200, 400, 400, Color.pink);
        MyFrame myFrame1 = new MyFrame(600, 200, 400, 400, Color.green);
        MyFrame myFrame2 = new MyFrame(1000, 200, 400, 400, Color.blue);
        MyFrame myFrame3 = new MyFrame(1400, 200, 400, 400, Color.yellow);
    }
    //继承TestFrame01类
    static class MyFrame extends Frame{
        static int count =0;
        public MyFrame(int x, int y, int w, int h, Color color){
            super("Myframe"+(++count));
            setVisible(true);
            setBackground(color);
            setBounds(x,y,w,h);
        }
    }
}
